/*
 * debugMonitor.h
 *
 *  Created on: Feb 4, 2012
 *      Author: Craig Markham
 *		Class:  TCSS 371
 *		Assignment:
 */

#ifndef DEBUGMONITOR_H_
#define DEBUGMONITOR_H_
#endif /* DEBUGMONITOR_H_ */

#include "cpu.h"

#define MAXBREAKPOINTS 16

#define MENU_EXIT         0
#define MENU_LOAD         1
#define MENU_RUN          2
#define MENU_SET_STEP     3
#define MENU_STEP		  4
#define MENU_SHOW_MEM     5
#define MENU_SHOW_REG     6


#define TRUE -1
#define FALSE 0

ushort	breakPoints[MAXBREAKPOINTS];
ushort	base;
ushort	currentPCValue;
ushort	memDumpStart;

/*
 * ADT - DebugMonitor
 * Data Type Description:
 * Contains debug state and breakpoint addresses.
 * Note you need not implement the latter in this phase
 */

//appropriate getters and setters

int mainMenu();

/*
 * open a text file containing a loadable program and read that text
 * into main memory starting at the load address given in the first line
 * of the file (use the same format as the LC-3 load file)
 */
void loadProgram(CPU *);

/*
 * sets cpu->PC to 0x3000, start of user program; sets debugState to RUN
 */
void runProgram(CPU *);

/*
 * sets cpu->PC to 0x3000, sets debugState to STEP
 */
void stepProgram(CPU *);

/*
 * refreshes register contents; returns to cpu_run()
 */
void showRegisters(CPU *);

/*
 * gets start address to dump and shows 16 words of memory in following format:
 *  address	byte  byte
 *  x3400    2A    01
 *            ^     ^
 *            |     +-- byte at x3401
 *            +-------- byte at x3400
 */
void showMemory(CPU *, int);

/*
 * refreshes all screen variables
 */
void showAll(CPU *);

void setBreakpoint();
